package com.atguigu.gmall.seckill.task;

import com.atguigu.gmall.seckill.biz.SeckillBizService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class UpSecKillGoodsTask {

    @Autowired
    SeckillBizService seckillBizService;

    @Scheduled(cron = "0 0 2 * * ?")
    public void upSeckillGoods() {
        log.info("定时任务启动了......");
        seckillBizService.upSeckillGoods();
        log.info("保存结束....");
    }
}
